package com.taotao.rest.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.taotao.common.pojo.TaotaoResult;
import com.taotao.rest.service.ItemService;

@Controller
@RequestMapping("/item")
public class ItemController {
	
	@Autowired
	private ItemService itemService;
	
	@RequestMapping("/info/{id}")
	@ResponseBody()
	public TaotaoResult getItemInfoById(@PathVariable Long id) {
		TaotaoResult result = itemService.getItemInfoById(id);
		return result;
	}
	
	@RequestMapping(value = "/desc/{id}",produces = "application/json;charset=UTF-8")
	@ResponseBody
	public TaotaoResult getItemDescById(@PathVariable Long id) {
		TaotaoResult result = itemService.getItemDescById(id);	
		return result;
	}
	@RequestMapping("/param/{id}")
	@ResponseBody
	public TaotaoResult getItemParamById(@PathVariable Long id) {
		TaotaoResult result = itemService.getItemParamById(id);
		return result;
	}
}
